﻿
namespace XRM.Security.WebUI.Models.Home
{
    public class MainPageModel
    {
        public const int WarningOpenRequestsCount = 30;
        public const int WarningExpiredCertificatesCount = 10;

        public int OpenRequestCount { get; set; }
        public int ExpiredCertificateCount { get; set; }

        public string RequestsPanelColor
        {
            get
            {
                if ( OpenRequestCount > WarningOpenRequestsCount )
                    return "panel-red";
                return OpenRequestCount > 0 ? "panel-yellow" : "panel-green";
            }
        }

        public string CertificatesPanelColor
        {
            get
            {
                if ( ExpiredCertificateCount > WarningExpiredCertificatesCount )
                    return "panel-red";
                return ExpiredCertificateCount > 0 ? "panel-yellow" : "panel-green";
            }
        }
    }
}